import fetch from '@/api'


// 查询
export function getContractList(params) {
    return fetch({
        method: 'get',
        url: `/pcContract`,
        params
    })
}

// 合同总数
export function totalContract(params) {
    return fetch({
        method: 'get',
        url: `/pcContract/mainStatistics`,
        params
    })
}

// 详情
export function viewContract(params) {
    return fetch({
        method: 'get',
        url: `/pcContract/${id}`,
        params
    })
}


// 新增
export function addContract(data) {
    return fetch({
        method: 'post',
        url: `/pcContract`,
        data
    })
}

// 编辑
export function updateContract(id, data) {
    return fetch({
        method: 'put',
        url: `/pcContract/${id}`,
        data,
    })
}


// 根据ID删除账户
export function delContract(id) {
    return fetch({
        method: 'delete',
        url: `/pcContract/${id}`,
    })
}

//提交
export function submitContract(id, data) {
    return fetch({
        method: 'put',
        url: `/pcContract/${id}/toAudit`,
        data,
    })
}

//终止
export function endContract(id, data) {
    return fetch({
        method: 'put',
        url: `/pcContract/${id}/end`,
        data,
    })
}

//延期
export function delayContract(id, data) {
    return fetch({
        method: 'put',
        url: `/pcContract/${id}/delay`,
        data,
    })
}

//审核通过
export function auditPass(id, data) {
    return fetch({
        method: 'put',
        url: `/pcContract/${id}/auditPass`,
        data,
    })
}

//审核不通过
export function auditFailed(id, data) {
    return fetch({
        method: 'put',
        url: `/pcContract/${id}/auditFailed`,
        data,
    })
}
